<template>
    <v-table
        :page-detail="false"
        :hasEdit="false"
        :checked="false"
        :searchFlag="false"
        :height="'316px'"
        :page="page"
        :pageSize="pageSize"
        :tableConfig="tableConfig"
        :tableData="tableData"
        :total="total"
        @findData="getTableData"
        @getTableData="getTableData"
        @searhData="searhData"
        @selectData="selectData"
        @setdialog="setdialog"
        @upData="getTableData"
        v-loading="loading"
        ref="table"
    ></v-table>
</template>

<script type="text/ecmascript-6">

import table from "commons/Table";
import baseMixin from "@/mixins/BaseMixin";

export default {
    name: "",
    mixins: [baseMixin],
    data() {
        return {
            loading: false,
            tableConfig: [
                {
                    label: this.$t('home.editwho'),
                    prop: "editwho",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('common.date'),
                    prop: "editdate",
                    input: "input",
                    width: "80px",
                    disabled: false
                },
                {
                    label: this.$t('home.preceiptqty'),
                    prop: "preceiptqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.creceiptqty'),
                    prop: "creceiptqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.rreceiptqty'),
                    prop: "rreceiptqty",
                    input: "input",
                    disabled: true
                },
                {
                    label: this.$t('home.shelvesqty'),
                    prop: "shelvesqty",
                    input: "input",
                    disabled: true
                },
                {
                    label: this.$t('outbound.qtypicked'),
                    prop: "pickingqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('out.createwave'),
                    prop: "waveqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.b2cqty'),
                    prop: "b2cqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.b2bqty'),
                    prop: "b2bqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.pob2bqty'),
                    prop: "pob2bqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.b2boutorderbinddingqty'),
                    prop: "b2boutorderbinddingqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.b2coutorderbinddingqty'),
                    prop: "b2coutorderbinddingqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.transmit'),
                    prop: "transferqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.transferlowerqty'),
                    prop: "transferlowerqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.cctaskqty'),
                    prop: "cctaskqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.itrnqty'),
                    prop: "itrnqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.lpnqty'),
                    prop: "lpnqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.titrnqty'),
                    prop: "titrnqty",
                    input: "input",
                    disabled: false
                },
                {
                    label: this.$t('home.fitrnqty'),
                    prop: "fitrnqty",
                    input: "input",
                    disabled: false
                },
            ],
            tableData: [],
          page: 1,
            pageSize: 10,
            total: 0,
            tableSelectData: [],
            tableSearhData: {},
        };
    },
    created() {
    },
    methods: {
        //选中的内容
        selectData(data) {
            this.tableSelectData = data;
        },
        async getTableData(page, data) {
            try {
                this.loading = true;
                let res = await this.$api.post(`/queryEfficiencyList/${page}`, data);
                
                    this.loading = false;
                    this.tableData = res.page.list;
                  this.page = res.page.curpage;
                    this.pageSize = res.page.pageSize;
                    this.total = res.page.total;
                
            } catch (e) {
                this.$message.error(e);
            } finally {
                this.loading = false;
            }
        },
        //搜索的值
        searhData(data, up) {
            if (!up) {
                this.tableSearhData = data;
            } else {
                this.tableSearhData = data;
                this.getTableData(1, this.tableSearhData);
            }
        },
        //设置弹框
        setdialog(data) {
        },
    },
    mounted() {
        this.getTableData(1, {});
    },
    watch: {
        "$parent.type"(data) {
            this.getTableData(1, {})
        }
    },
    components: {
        "v-table": table,
    }
};
</script>

<style scoped>

</style>
